<?php

/*
=====================================================
 Generic Toolbox - by Carl Wells
-----------------------------------------------------
-----------------------------------------------------
 Copyright (c) 2009 Carl Wells
=====================================================
 THIS IS COPYRIGHTED SOFTWARE
 PLEASE READ THE LICENSE AGREEMENT
=====================================================
 File: system/core/category.class.php
-----------------------------------------------------
 Purpose: Model of a Category.
 A Category is the base of the navigation.
=====================================================
*/

class Category
{

	// CONTRUCTOR
	function Category(){
	
    }
    
    
    // grab the sectors from a db and return an array
    function getCategories($id){
		require_once ( SITEBASE."/system/db/dbCategory.class.php" );
		
	   // require_once("system/db/dbCategory.class.php");
	    $db = new Dbcategory();
   	 	// connect to database
		$result =  $db->selectQuery("SELECT * FROM `categories` WHERE `sectorId` = ".$id.";");
		$array = $db->returnArray($result);
		// return data as an array;
		return $array;
    }
    
    // grab a specific sector from a db and return an array
    function getIndividualCategory($id){
	    require_once ( SITEBASE."/system/db/dbCategory.class.php" );
	    $db = new Dbcategory();
   	 	// connect to database
		$result =  $db->selectQuery("SELECT * FROM `categories` WHERE `id` = ".$id.";");
		$array = $db->returnArray($result);
		// return data as an array;
		return $array;
    }
    
}

?>